<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>定位特殊应用</title>
    <style>
        .outer {
            width: 800px;
            height: 400px;
            background-color: #888;
            /* overflow: hidden; */
            position: relative;
        }
        .inner {
            width: 400px;
            height: 100px;
            background-color: orange;
            font-size: 20px;
/*             margin: 0 auto;
            margin-top: 150px; */ 
            position: absolute;
            top: 0;
            left: 0;
            bottom: 0;
            right: 0;
            margin: auto; /* 父元素div居中 */
        }
    </style>
</head>
<body>
    <div class="outer">
        <div class="inner">nihaoa</div>
    </div>
    
</body>
</html>